<%= render 'fae/shared/index_header', title: @klass_humanized.pluralize.titleize %>

<main class="content">
  <div class="collapsible-toggle">Open All</div>

  <div class="collapsible">
    <%= content_tag(:h3, "#{@klass_humanized.pluralize} (#{@items.length})") %>
    <table class="js-sort-row">
      <thead>
        <tr>
          <th class="th-sortable-handle"></th>
          <th>Name</th>
          <th class="-action-wide">Modified</th>
          <th class="-action-wide" data-sorter="false">On Stage</th>
          <th class="-action-wide" data-sorter="false">On Prod</th>
          <th class="-action" data-sorter="false"></th>
        </tr>
      </thead>

      <tbody>
        <% @items.each do |item| %>
          <tr id="<%= "#{@klass_singular}_#{item.id}" %>">
            <td class="sortable-handle">
              <i class="icon-sort"></i>
            </td>
            <td><%= link_to item.fae_display_field, edit_admin_selling_point_path(item) %></td>
            <td><%= fae_date_format item.updated_at %></td>
            <td><%= fae_toggle item, :on_stage %></td>
            <td><%= fae_toggle item, :on_prod %></td>
            <td><%= fae_delete_button item %></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</main>